<script lang="ts" setup>
import Nav from './components/Nav.vue'
import { onMounted } from 'vue'

onMounted(() => {
  // 监听购物车和订单更新事件
  window.addEventListener('cartUpdated', () => {
    console.log('购物车已更新')
  })
  
  window.addEventListener('ordersUpdated', () => {
    console.log('订单已更新')
  })
})
</script>

<template>
  <Nav></Nav>
  <!-- 路由组件的占位符 -->
  <router-view style="margin-top: 60px;"></router-view>
</template>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
  background-color: #f5f7fa;
  color: #606266;
}

#app {
  min-height: 100vh;
}
</style>